/*
 * Author: Ruben Unteregger
 * 
 */

package com.example.iorder.reservation.read;



import com.example.iorder.R;
import com.example.iorder.config.Config;
import com.example.iorder.reservation.Reservation;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;


public class ActivityTab_ShowReservation extends Activity
{
//	@Override
	protected void onCreate(Bundle savedInstanceState) 
	{
		super.onCreate(savedInstanceState);
		setContentView(R.layout.reservation_show);

//		this.setTitle("iOrder | Reservation ");
		
		// Get current reservation.
		Reservation lReservation =  Activity_ShowAllReservations.getSelectedReservation();
		
		// Get all GUI elements
		TextView lReservationDate = (TextView) findViewById(R.id.reservation_date_data);
		TextView lRestaurantName = (TextView) findViewById(R.id.restaurant_name_data);
		TextView lRestaurantAddress = (TextView) findViewById(R.id.restaurant_address_data);
		TextView lRestaurantCity = (TextView) findViewById(R.id.restaurant_city_data);
		TextView lRestaurantPhone = (TextView) findViewById(R.id.restaurant_phone_data);
//		TextView lReservationTitle = (TextView) findViewById(R.id.reservation_title);
		TextView lReservationStatus = (TextView) findViewById(R.id.reservation_state_data);	
		TextView lTableDetails = (TextView) findViewById(R.id.reservation_tabledetails_data);	
		
		
		lReservationDate.setText(lReservation.getDate() + "  " + lReservation.getTime());
		lRestaurantName.setText(lReservation.getName());
		lRestaurantAddress.setText(lReservation.getAddress());
		lRestaurantCity.setText(lReservation.getCity());
		lRestaurantPhone.setText(lReservation.getPhoneNumber());
		lTableDetails.setText(lReservation.getTabledetails());
		
String lStatusStr = Config.RESERVATION_INT2STATUS[lReservation.getStatus()];
		lReservationStatus.setText(lStatusStr);
	}
}
